<html>
<body>
 <h1>test</h1>
  <?php
  //test
  echo "first php application </br>";
  
  print "second </br>";
  $a=10;
  echo "a=$a";
  $b="</br>gc test var dump";
  var_dump($b);
  $v1=null;
  $v2=6;
  unset($v2);
  //使用SERVER内置函数
  echo "</br>".$_SERVER['SERVER_NAME']. "and  </br>";
  echo $_SERVER['PHP_SELF']."</br>";
  echo PHP_OS."</br>";
  echo PHP_VERSION;
  //定义常量
  define("test","qwer2r");
  echo test;
  //算数运算符，跟c#差不多   除法时，是以浮点值计算
  $numb1=101;
  $numb2=5;
  echo "</br>".$numb1/$numb2;

  echo "</br>".$numb1+=$numb2;

  echo "</br>".$numb1++;

  echo "</br>".++$numb1;

  //运算关系也跟c#差不多
  echo "</br>".var_dump($numb1>100 and $numb2<10);

  //按地址赋值   值会跟着改变
  $numb3=&$numb1;
  echo "</br>number1=".$numb1."   number3=".$numb3;
  $numb1++;
  echo "</br>number1=".$numb1."   number3=".$numb3;

  //控制语句
  if($numb2>1)
  {
   echo "</br> numer2 >1";
  }
  $arry=range(1,10);
  shuffle($arry);
  echo "</br> random=".$arry[0];

  echo "</br>";
  switch($arry[0]){
    case 1:
      echo "cao ni  ma 1";
      break;
      case 2:
      echo "good boy! 2";
      break;
      default:
      echo "other number";
  }
 //for 循环和c#大不一样
 for($i=10;$i%100<20;$i+=2){
   print($i."</br>");
 }


 function hi(){
   
 }
  ?>



</body>
</html>